package com.zdlee.netty.server17.client.console;

import com.zdlee.netty.server17.protocol.request.JoinGroupRequestPacket;
import io.netty.channel.Channel;

import java.util.Scanner;

/**
 * @author zdlee
 * @description: ${DESCRIPTION}
 * @create 2018-12-01 15:24
 */
public class JoinGroupConsoleCommand implements ConsoleCommand{

    @Override
    public void exec(Scanner sc, Channel channel) {
        JoinGroupRequestPacket joinGroupRequestPacket = new JoinGroupRequestPacket();

        System.out.print("输入 groupId，加入群聊：");
        String groupId=sc.next();

        joinGroupRequestPacket.setGroupId(groupId);
        channel.writeAndFlush(joinGroupRequestPacket);

    }
}
